public class Seat {
    private int row;
    private int col;
    private String phone;

    public Seat(int row, int col) {
        this.row = row;
        this.col = col;
        this.phone = null;
    }

    public int getRow() {
        return row;
    }

    public int getCol() {
        return col;
    }

    public String getPhone() {
        return phone;
    }

    public boolean isSold() {
        return phone != null;
    }

    public void sell(String phone) throws TicketException {
        if (this.phone != null) {
            throw new TicketException("座位已售出");
        }
        this.phone = phone;
    }
} 